﻿@{
    ViewBag.Title = "_ShowMenu";
}

@*<script src="../../js/table/jquery.dataTables.min.js" type="text/javascript"></script>*@
<script type="text/javascript">
    $(document).ready(function () {
        //        $('#formAddNewRow').hide();
        var oTable2 = $('#MenuListTable').dataTable({

            "bServerSide": true,
            "sAjaxSource": "/UserRole/AjaxGetShowMenu",
            "bProcessing": true,
            "sPaginationType": "full_numbers",
            "aoColumns":
[
{ "sName": "MenuId", "sTitle": "MenuId", "bVisible": false, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[0]; } },
{ "sName": "MenuName", "sTitle": "MenuName", "sWidth": 100, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[1]; } },
{ "sName": "URL", "sTitle": "URL", "sWidth": 120, "bVisible": false, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[2]; } },
{ "sName": "Title", "sTitle": "Title", "sWidth": 100, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[3]; } },
{ "sName": "Description", "sTitle": "Description", "sWidth": 100, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[4]; } },
{ "sName": "Action", "sTitle": "Action", "sWidth": 100, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[5]; } },



]
        });
        oTable2 = $('#MenuListTable').dataTable();





    });

    function DeleteMenu(menuId) {
        var temp = confirm('Are you sure want to delete?');
        if (temp == true) {
            $.ajax({
                type: "POST",
                url: "/UserRole/DeleteMenu?menuId=" + menuId,
                success: function (result) {
                    var oTable2 = $('#MenuListTable').dataTable();
                    oTable2.fnDraw();
                    return false;
                }
            });
        }


    }
    
</script>

<div class="grid_5">
            <div class="box round">
            <div id="demo">
                <h2>List of Menu</h2>
                <div class="block">
                      
   @* <button id="btnDeleteRow" value="cancel" class="btn btn-orange">Delete Leave Record</button>*@
                    <table class="data display datatable" id="MenuListTable">
					<thead>
                <tr>
                 
                     <th>
                    </th>
                    <th>
                    </th>
                    <th>
                    </th> 
                    <th>
                    </th>                    
                    <th>
                    </th>
                    <th>
                    </th>
                    
                    
                </tr>
            </thead>
					
				</table>
                    

               
                 


    </div>
</div>
</div>

</div>